import {defineStore} from 'pinia'
import {reqSearchData,reqRealWord} from '../api/search/search'
import type {SearchData,KeyWordList} from '../api/search/model/search' 
export const useSearchStore=defineStore('search',{
    state:()=>{
        return{
            searchList:{} as SearchData,
            realKeyWordsList:{}
        }
    },
    actions:{
        async getSearchData(){
            const res = await reqSearchData()
            this.searchList = res
        },
        async getKeyWordsList(keyWord:string){
            const res = await reqRealWord(keyWord)
            this.realKeyWordsList = res
            console.log(res.directlyList)
        }
    }
})